package a9;

import a9.Latitude2;
import a9.Longitude2;

public class GeoPoint2 {

	private Latitude2 lat;
	private Longitude2 lon;

	public GeoPoint2(Latitude2 lat, Longitude2 lon) {
		this.lat = lat;
		this.lon = lon;
	}

	public Latitude2 getLat() {
		return lat;
	}

	public Longitude2 getLon() {
		return lon;
	}
	
	public double getDistance (double lat1, double lon1, double lat2, double lon2){
		double distance;
		int earthradius = 24901;
		distance = earthradius * Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat2) * Math.cos(lat2) * Math.cos(lon1 - lon2));
		return distance;
	}

}
